package cn.tangwei.basic.utils;

import lombok.Data;

@Data
public class AjaxRusult {
    private Boolean success = true;
    private String message = "操作成功";
    private Object resultObj;

    public static AjaxRusult me(){
        return new AjaxRusult();
    }

    /**
     * 链式编程
     * @param success
     * @return
     */
    public AjaxRusult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    /**
     * 链式编程
     * @param message
     * @return
     */
    public AjaxRusult setMessage(String message) {
        this.success = false;
        this.message = message;
        return this;
    }

    public AjaxRusult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
